cwd = File.expand_path(File.dirname(__FILE__))
load "#{cwd}/excel.rb"


include Aio::Base::Toolkit::Excel

excel = WorkBook.new
excel.show
worksheet = excel.add_worksheet("sheet")
=begin
worksheet.add_title("title")
row = worksheet.add_row
row << ["elin", 1]
row.height = 20
=end

worksheet.width("a", 15)
worksheet.width("b", 10)
worksheet.width("c", 15)
worksheet.width("d", 15)
worksheet.width("e", 14)
worksheet.width("f", 7)
worksheet.width("g", 12)

row = worksheet.add_row
  row.merge("a", "g")
  row << "湖北中行现场巡检报告"
	row.set_style("a", "TitleStyle")
row = worksheet.add_row
	row.merge("b", "g")
	row << ["巡检命令", "1.基本信息"]
	row.set_style("a", "BoldStyle")
	row.set_style("b", "BoldStyle")

#========== show version
row = worksheet.add_row
	row.merge("c", "d")
	row.merge("f", "g")
	row << ["show version", "设备名称", "A_HBWHA_COR_CS01", "设备型号", "WS-C6506-E"]
	row.set_style("a", "BoldStyle")
row = worksheet.add_row
	row.merge("c", "d")
	row.merge("f", "g")
	row << ["show version", "IP", "30.48.1.248", "FLASH(MB)", "512"]
row = worksheet.add_row
	row.merge("c", "g")
	row << ["show version", "运行时间", "26 weeks, 5 days, 5 hours, 44 minutes"]
row = worksheet.add_row
	row << [
		"show version",
		"内存", "512",
		"IOS版本", "12.2(33)SXI4a",
		"紧急版本", "12.2(17r)SX7" ]
row = worksheet.add_row
	row.merge("c", "g")
	row << [
		"show version",
		"IOS特性集", "s72033-ipservicesk9-mz.122-33.SXI4a"]

worksheet.merge("a3","a7")

#========= show inventory
row = worksheet.add_row
	row.merge("e", "g")
	row << [
		"show inventory", "硬件信息", "接口卡型号","序列号",
		"RMA历史记录(年/月/日)"]
	row.style("a", "BoldStyle")
row = worksheet.add_row
	row << ["show inventory",
			"机箱", "WS-C6506-E", "SAL1439URLY", "", "", ""]
row = worksheet.add_row
	row << ["show inventory",
			"插槽1", "WS-C6506-E", "SAL1439URLY", "", "", ""]
row = worksheet.add_row
	row << ["show inventory",
			"插槽2", "WS-C6506-E", "SAL1439URLY", "", "", ""]
row = worksheet.add_row
	row << ["show inventory",
			"插槽3", "WS-C6506-E", "SAL1439URLY", "", "", ""]
row = worksheet.add_row
	row << ["show inventory",
			"插槽4", "WS-C6506-E", "SAL1439URLY", "", "", ""]
worksheet.merge("a8", "a13")
#========= 
row = worksheet.add_row
	row.merge("b", "g")
	row << ["", "2.运行状态巡检信息采集"]
	row.style("b", "BoldStyle")
row = worksheet.add_row
 	row.merge("d", "f")
	row << ["", "项目", "内容", "结果", "备注"]
	row.style("b", "BoldStyle")
	row.style("c", "BoldStyle")
	row.style("d", "BoldStyle")
	row.style("g", "BoldStyle")
#========= show process cpu
row = worksheet.add_row
	row.merge("d", "f")
	row << ["show process cpu", "路由状态",
			"cpu利用率(%)", "five minutes: 10%", ""]
	row.style("a", "BoldStyle")
row = worksheet.add_row
	row.merge("d", "f")
	row << ["show process mem", "路由状态",
			"内存利用率(%)", "24.00", ""]
	row.style("a", "BoldStyle")
row = worksheet.add_row
	row.merge("d", "f")
	row << ["show environment", "路由状态",
			"温度", "√", ""]
	row.style("a", "BoldStyle")
row = worksheet.add_row
	row.merge("d", "f")
	row << ["show environment", "路由状态",
			"电源", "正常√ 不正常□", ""]

		
